<div class="list-client">

    <div class="button-new">
        <?php
        //echo CHtml::link('<i class="icon-white icon-plus-sign"></i> '.Yii::t('app', 'Add new'), array('task/add'), array('class' => 'btn btn-success'));
        ?>
    </div>
    <div id="ajaxmessagetxt">
        <?php
        $flashMessages = Yii::app()->user->getFlashes();
        if ($flashMessages) {
            foreach($flashMessages as $key => $message) {
                echo '<div class="alert alert-' . $key . ' fade in"><button type="button" class="close" data-dismiss="alert">×</button>' . $message . "</div>\n";
            }
        }
        ?>
    </div>

    <?php
    //    $this->widget('zii.widgets.grid.CGridView', array(
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id'=> 'task',
        'dataProvider'=>$model->search_by_user(),
        'filter' => $model,
        'enableSorting' => false,
        'type' => 'striped',
        'rowCssClassExpression' => '
            ( Common::compareDeadline($data->deadline) ? "tr_deadline" : "")
        ',
        'columns'=>array(
            'id_task',
            'id_by_matter',
            array(
                'name' => 'id_attribute',
                'value'=> 'Common::getValue($data->id_attribute, Attribute::getListAttribute())',
                'filter' => false
            ),
            array(
                'name' => 'quantity',
                'filter'=> false,
                'value'=> 'TaskAnalystSpecial::getValueSpecialByTask($data->id_task, "quantity") ? TaskAnalystSpecial::getValueSpecialByTask($data->id_task, "quantity") : ""',
            ),

            'deadline',
            array(
                'name' => 'status',
                'value'=> 'Common::getValue($data->status, Constant::getStatus())',
                'filter' => Constant::getStatus(),
                'cssClassExpression'=>'"hnx-".Constant::getStatustag($data->status)',
            ),
            array(
                'class'=>'bootstrap.widgets.TbButtonColumn',
                'template' => '{viewtask} {updatestatus}',
                'htmlOptions' => array('width'=>'150', 'align'=>'center'),
                'buttons'=>array(
                    'viewtask' => array(
                        'label'=>Yii::t('app', 'View detail'),
                        'icon'=>'eye-open',
                        'url'=>'Yii::app()->createUrl("user/taskdetail", array("id"=>$data->id_task))',
                        'options'=>array(
                            'class'=>'view-action',
                        ),
                    ),
                    'updatestatus' => array(
                        'label'=>Yii::t('app', 'Update status'),
                        'icon'=>'pencil',
                        'url'=>'Yii::app()->createUrl("user/updatestatus", array("id"=>$data->id_task))',
                        'options'=>array(
                            'class'=>'view-action',
                        ),
                    ),
                ),
            ),
        ),
    ));
    ?>
</div>